import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Objects;

public class demo8 {
    public static void main(String[] args) {
        ArrayList<Object> list = new ArrayList<>();
        for (int i = 2; i <=20000; i++) {
            int a = 0;
            for (int j = 2; j < i; j++) {
                if(i%j == 0){
                    a ++;
                    break;
                }
            }
            if(a ==0){
                list.add(i);
            }
        }
        System.out.println(list.get(2022));
    }
}
